﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="NewDashboard.aspx.cs" Inherits="NewDashboard" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>AdminDashboard</title>
    <script src="JS/Plugins/1.4.2-jquery.min.js" type="text/javascript"></script>
    <link href="CSS/base-jquery-ui.css" rel="stylesheet" type="text/css" />
    <script src="JS/Plugins/jquery-1.9.1.js" type="text/javascript"></script>
    <script src="JS/1.10.1-jquery-ui.js" type="text/javascript"></script>
    <link href="adminHeaderDesign.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="css/adminmenu.css" type="text/css">
    <script type="text/javascript" src="js/sliding.form.js"></script>
    <link rel="stylesheet" href="css/style11.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="css/adminLogin.css" type="text/css" media="screen" />
    <link rel="stylesheet" type="text/css" href="css/styleLocation.css" media="screen" />
    <%--<script src="js/form-fun.jquery.js" type="text/javascript" charset="utf-8"></script>--%>
    <style>

.textfield{ border-top: 1px solid #c1c1c1;border-left: 1px solid #c1c1c1;border-right: 1px solid #ebebeb; border-bottom: 1px solid #ebebeb;background: #fff url(http://imgs.bharatmatrimony.com/bmimgs/inputbg.gif) no-repeat top left;   font-family:arial, verdana;  color:#666; height:19px; padding:2px 0px 0px 5px; }
.selectfield{background:url(http://imgs.bharatmatrimony.com/bmimgs/inputbg.gif) no-repeat scroll left top #FFFFFF; border-color:#C1C1C1 #EBEBEB #EBEBEB #C1C1C1;border-style:solid;border-width:1px;color:#666666;font-family:arial,verdana;font-size:12px;height:22px;padding:1px 0 2px 2px;}
.inputtext, .addtxtfield{ border-top: 1px solid #c1c1c1;border-left: 1px solid #c1c1c1;border-right: 1px solid #ebebeb; border-bottom: 1px solid #ebebeb;font-family:arial, verdana;  color:#666; padding:2px 0px 0px 5px; }
#chkradio{ !important; vertical-align:center; !important;}<a href="moreDetails.aspx">moreDetails.aspx</a>
.radiomargin { vertical-align:middle; display:inline; float:none; margin:0px 4px 0px 3px; _margin:0px 2px 0px 1px; }
checkbox{vertical-align:middle;}
label {font-size:100%;font: bold 12px arial, verdana;margin: 0;padding: 0;text-align: left;}

#logindialog{


position: absolute;
    margin: 50px 0 0 -125px;
    top: 50%;
    left: 50%;
}

.clear { clear: both }

html,body{
margin:0px;	
padding:0px;
background-color:white;
}

#wrapper{

margin-left:80px;
margin-right:80px;
margin-top:20px;
margin-bottom:20px;
padding:1px;
background-color:#101010;
}

#header{

height:160px;
margin-bottom:2px;
background-color:#FFFFFF;
}

#header-center{
margin-left:35%;
margin-top:-70px;

}

#navbar{

margin-top:-40px;

}

#content{
min-height:600px;
min-width:640px;
padding:5px;
background-color:#FFFFFF;
}

#footer{
text-align:center;
font-weight:bold;
color:#FFFFFF;
height:50px;
clear:both;
margin-top:2px;
padding:5px;
background-color:#101010;
}
.d
{
background:#404040;
border-color:#404040;
event: "mouseover";
}
.divrow
{
margin-top:15px;
margin-left:20px;
margin-bottom:10px;
}
.divlbl
{
float:left;
width:150px;
border-color:#404040;
border-width:1px;

}
.ProfileDetails
{
font-size:100%;font: 12px arial, verdana;margin: 0;padding: 0;text-align: left;
float:center;
border-style:solid;
border-radius: 15px;
border-color:#404040;
border-width:1px;
width:auto;
height:350px;
	
}

.button {
-moz-box-shadow:inset 0px 1px 0px 0px #97c4fe;
-webkit-box-shadow:inset 0px 1px 0px 0px #97c4fe;
box-shadow:inset 0px 1px 0px 0px #97c4fe;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #404040), color-stop(1, #404040) );
background:-moz-linear-gradient( center top, #3d94f6 5%, #1e62d0 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#3d94f6', endColorstr='#1e62d0');
background-color:#404040;
-moz-border-radius:6px;
-webkit-border-radius:6px;
border-radius:6px;
border:1px solid #337fed;
display:inline-block;
color:#ffffff;
font-family:arial;
font-size:15px;
font-weight:bold;
padding:6px 24px;
text-decoration:none;
text-shadow:1px 1px 0px #1570cd;
}
.button:hover 
{
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #707070), color-stop(1, #787878) );
background:-moz-linear-gradient( center top, #707070 5%, #787878 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#707070', endColorstr='#787878');
background-color:#707070;
}
.button:active 
{
position:relative;
top:1px;
}

#accordion .ui-accordion-content
        {
            width: auto;
            background-color: #FFFFFF;
            color: #777;
            font-size: 10pt;
            line-height: 16pt;
        }
        #accordion .ui-accordion-header
        {
            background-color: #3366FF;
            margin: 0px;
            color: White;
        }


</style>
    <script type="text/javascript">

        function refreshLocation() {

            $('#location').css({
                "border": "1px solid #e6e6e6",
                "background": "#FFFFFF"

            });
            $('#name').css({
                "border": "1px solid #e6e6e6",
                "background": "#FFFFFF"

            });
            $('#email').css({
                "border": "1px solid #e6e6e6",
                "background": "#FFFFFF"

            });
            $('#mobile').css({
                "border": "1px solid #e6e6e6",
                "background": "#FFFFFF"

            });

            return false;
        }

        function validateLocation() {


            if ($("#location").val().trim().length === 0) {

                alert("Some Fields are Empty");
                $('#location').css({
                    "border": "1px solid red",
                    "background": "#FFCECE"

                });

            }
            else if ($("#name").val().trim().length === 0) {

                alert("Some Fields are Empty");
                $('#name').css({
                    "border": "1px solid red",
                    "background": "#FFCECE"

                });

            }
            else if ($("#email").val().trim().length === 0) {

                alert("Some Fields are Empty");
                $('#email').css({
                    "border": "1px solid red",
                    "background": "#FFCECE"

                });

            }

            else if ($("#mobile").val().trim().length === 0) {

                alert("Some Fields are Empty");
                $('#mobile').css({
                    "border": "1px solid red",
                    "background": "#FFCECE"

                });

            }
            else {
                //alert(1);
                createSalesUser();
            }
            return false;
        }

        function validateSalesuser() {


            if ($("#txtlocation").val().trim().length === 0) {

                alert("Some Fields are Empty");
                $('#txtlocation').css({
                    "border": "1px solid red",
                    "background": "#FFCECE"

                });

            }
            else if ($("#txtusername").val().trim().length === 0) {

                alert("Some Fields are Empty");
                $('#txtusername').css({
                    "border": "1px solid red",
                    "background": "#FFCECE"

                });

            }
            else if ($("#txtemail").val().trim().length === 0) {

                alert("Some Fields are Empty");
                $('#txtemail').css({
                    "border": "1px solid red",
                    "background": "#FFCECE"

                });

            }

            else if ($("#txtmobile").val().trim().length === 0) {

                alert("Some Fields are Empty");
                $('#txtmobile').css({
                    "border": "1px solid red",
                    "background": "#FFCECE"

                });

            }
            else {
                //alert(1);
                updateSalesUser();
            }
            return false;
        }


    </script>

    <script type="text/javascript">


    
    </script>

    <script type="text/javascript">

        $(document).ready(function () {

            //            $('#btnSubmit').click(function (e) {
            //                var isValid = true;
            //                $('input[type="text"].required').each(function () {
            //                    if ($.trim($(this).val()) == '') {
            //                        isValid = false;
            //                        $(this).css({
            //                            "border": "1px solid red",
            //                            "background": "#FFCECE"

            //                        });
            //                        

            //                    }
            //                    else {
            //                        createSalesUser();
            //                        $(this).css({
            //                            "border": "",
            //                            "background": ""
            //                        });
            //                    }
            //                });
            //                if (isValid == false)
            //                    e.preventDefault();
            //                else
            //                    alert('Thank you for submitting');
            //            });

            var people = getParameterByName('Person');
            document.getElementById('loggedperson').innerHTML = people;

            var param = getParameterByName('userid');
            if (param != null && param != "") {

                $('#userid').html(param);

            }
            //alert(param);
        });


        function getParameterByName(name) {
            name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
            var regexS = "[\\?&]" + name + "=([^&#]*)";
            var regex = new RegExp(regexS);
            var results = regex.exec(window.location.href);
            if (results == null)
                return "";
            else
                return decodeURIComponent(results[1].replace(/\+/g, " "));
        }

    </script>
    <script>

        $(function () {
            $("#accordion").accordion();
        });
  
    </script>
    <script type="text/javascript">
        function showMessage(which) {
            if (which == 1) {
                document.getElementById("cre").style.display = "block";
                document.getElementById("mod").style.display = "none";
                document.getElementById("del").style.display = "none";
            }
            else if (which == 2) {
                document.getElementById("cre").style.display = "none";
                document.getElementById("mod").style.display = "block";
                document.getElementById("del").style.display = "none";
            }
            else {
                document.getElementById("cre").style.display = "none";
                document.getElementById("mod").style.display = "none";
                document.getElementById("del").style.display = "block";
            }
        }
    </script>
    <script type="text/javascript">

        function createSalesUser() {

            var jData = {};
            jData.location = $('#location').val();
            jData.name = $('#name').val();
            jData.emailId = $('#email').val();
            jData.mobileNo = $('#mobile').val();

            $.ajax({

                type: "POST",
                url: "SalesUserService.svc/saveSalesUser",
                data: JSON.stringify(jData),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    var Result = eval('(' + response.d + ')');
                    alert(Result["Message"]);
                    alert("The salesuser ID is " + Result["Confirmation"] + " you can find the salesuser details in View Details column");
                    window.location = "NewDashboard.aspx";

                },
                failure: function (msg) {
                    alert(msg);
                },
                error: function (jqXHR, exception) {
                    if (jqXHR.status === 0) {
                        alert('Not connect.\n Verify Network.');
                    } else if (jqXHR.status == 404) {
                        alert('Requested page not found. [404]');
                    } else if (jqXHR.status == 500) {
                        alert('Internal Server Error [500].');
                    } else if (exception === 'parsererror') {
                        alert('Requested JSON parse failed.');
                    } else if (exception === 'timeout') {
                        alert('Time out error.');
                    } else if (exception === 'abort') {
                        alert('Ajax request aborted.');
                    } else {
                        alert('Uncaught Error.\n' + jqXHR.responseText);
                    }
                }

            });
            return false;
        }


        function fetchUserDetails() {


            if ($("#txtBox").val().trim().length === 0) {

                alert(" Field is Empty");
                $('#txtBox').css({
                    "border": "1px solid red",
                    "background": "#FFCECE"

                });

            }
            else {

                var jData = {};
                jData.UserID = $('#txtBox').val();


                $.ajax({
                    type: "POST",
                    url: "SalesUserService.svc/fetchUserDetails",
                    data: JSON.stringify(jData),
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (response) {
                        var Result = eval('(' + response.d + ')');
                        $('#txtlocation').val(Result["salesUserLocation"]);
                        $('#txtusername').val(Result["salesUserName"]);
                        $('#txtemail').val(Result["salesUserEmail"]);
                        $('#txtmobile').val(Result["salesUserMobile"]);



                    },
                    failure: function (msg) {
                        alert(msg);
                    },
                    error: function (jqXHR, exception) {
                        if (jqXHR.status === 0) {
                            alert('Not connect.\n Verify Network.');
                        } else if (jqXHR.status == 404) {
                            alert('Requested page not found. [404]');
                        } else if (jqXHR.status == 500) {
                            alert('Internal Server Error [500].');
                        } else if (exception === 'parsererror') {
                            alert('Requested JSON parse failed.');
                        } else if (exception === 'timeout') {
                            alert('Time out error.');
                        } else if (exception === 'abort') {
                            alert('Ajax request aborted.');
                        } else {
                            alert('Uncaught Error.\n' + jqXHR.responseText);
                        }
                    }

                });

            }
            return false;
        }

        function updateSalesuser() {

            var jData = {};
            jData.userId = $('#txtBox').val();
            jData.UserLocation = $('#txtlocation').val();
            jData.UserName = $('#txtusername').val();
            jData.UserEmail = $('#txtemail').val();
            jData.UserMobile = $('#txtmobile').val();


            $.ajax({
                type: "POST",
                url: "SalesUserService.svc/modifySalesUser",
                data: JSON.stringify(jData),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    var Result = eval('(' + response.d + ')');
                    alert(Result["Message"]);

                    window.location = "NewDashboard.aspx";

                },
                failure: function (msg) {
                    alert(msg);
                },
                error: function (jqXHR, exception) {
                    if (jqXHR.status === 0) {
                        alert('Not connect.\n Verify Network.');
                    } else if (jqXHR.status == 404) {
                        alert('Requested page not found. [404]');
                    } else if (jqXHR.status == 500) {
                        alert('Internal Server Error [500].');
                    } else if (exception === 'parsererror') {
                        alert('Requested JSON parse failed.');
                    } else if (exception === 'timeout') {
                        alert('Time out error.');
                    } else if (exception === 'abort') {
                        alert('Ajax request aborted.');
                    } else {
                        alert('Uncaught Error.\n' + jqXHR.responseText);
                    }
                }

            });
            return false;
        }


        function getsalesuser() {

            if ($("#fetID").val().trim().length === 0) {

                alert(" Field is Empty");
                $('#fetID').css({
                    "border": "1px solid red",
                    "background": "#FFCECE"

                });

            }

            else {

                var jData = {};
                jData.UserID = $('#fetID').val();


                $.ajax({
                    type: "POST",
                    url: "SalesUserService.svc/fetchUser",
                    data: JSON.stringify(jData),
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (response) {
                        var Result = eval('(' + response.d + ')');
                        $('#fetlocation').html(Result["salesUserLocation"]);
                        $('#fetusername').html(Result["salesUserName"]);
                        $('#fetemail').html(Result["salesUserEmail"]);
                        $('#fetmobile').html(Result["salesUserMobile"]);



                    },
                    failure: function (msg) {
                        alert(msg);
                    },
                    error: function (jqXHR, exception) {
                        if (jqXHR.status === 0) {
                            alert('Not connect.\n Verify Network.');
                        } else if (jqXHR.status == 404) {
                            alert('Requested page not found. [404]');
                        } else if (jqXHR.status == 500) {
                            alert('Internal Server Error [500].');
                        } else if (exception === 'parsererror') {
                            alert('Requested JSON parse failed.');
                        } else if (exception === 'timeout') {
                            alert('Time out error.');
                        } else if (exception === 'abort') {
                            alert('Ajax request aborted.');
                        } else {
                            alert('Uncaught Error.\n' + jqXHR.responseText);
                        }
                    }

                });
            }
                return false;
            
        }

        function removeSalesuser() {

            var jData = {};
            jData.UserId = $('#fetID').val();


            $.ajax({
                type: "POST",
                url: "SalesUserService.svc/removeSalesuser",
                data: JSON.stringify(jData),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    var Result = eval('(' + response.d + ')');
                    alert(Result["Message"]);

                    window.location = "NewDashboard.aspx";

                },
                failure: function (msg) {
                    alert(msg);
                },
                error: function (jqXHR, exception) {
                    if (jqXHR.status === 0) {
                        alert('Not connect.\n Verify Network.');
                    } else if (jqXHR.status == 404) {
                        alert('Requested page not found. [404]');
                    } else if (jqXHR.status == 500) {
                        alert('Internal Server Error [500].');
                    } else if (exception === 'parsererror') {
                        alert('Requested JSON parse failed.');
                    } else if (exception === 'timeout') {
                        alert('Time out error.');
                    } else if (exception === 'abort') {
                        alert('Ajax request aborted.');
                    } else {
                        alert('Uncaught Error.\n' + jqXHR.responseText);
                    }
                }

            });
            return false;
        }

//        function validCreateLocation() {


//            if ($("#locName").val().trim().length === 0) {

//                    alert("Some Fields are Empty");
//                    $('#locName').css({
//                        "border": "1px solid red",
//                        "background": "#FFCECE"

//                    });

//                }
//                else if ($("#locAddress").val().trim().length === 0) {

//                    alert("Some Fields are Empty");
//                    $('#locAddress').css({
//                        "border": "1px solid red",
//                        "background": "#FFCECE"

//                    });

//                }
//                else if ($("#locCountry").val().trim().length === 0) {

//                    alert("Some Fields are Empty");
//                    $('#locCountry').css({
//                        "border": "1px solid red",
//                        "background": "#FFCECE"

//                    });

//                }

//                else if ($("#locState").val().trim().length === 0) {

//                    alert("Some Fields are Empty");
//                    $('#locState').css({
//                        "border": "1px solid red",
//                        "background": "#FFCECE"

//                    });

//                }
//                else if ($("#locCity").val().trim().length === 0) {

//                    alert("Some Fields are Empty");
//                    $('#locCity').css({
//                        "border": "1px solid red",
//                        "background": "#FFCECE"

//                    });

//                }
//                else {
//                    //alert(1);
//                    createLocation();
//                }
//                return false;
//            }


        

        function createLocation() {

            var jData = {};
            jData.LocationName = $('#locName').val();
            jData.LocationAddress = $('#locAddress').val();
            jData.LocationCountry = $('#locCountry').val();
            jData.LocationState = $('#locState').val();
            jData.LocationCity = $('#locCity').val();

            $.ajax({
                type: "POST",
                url: "LocationService.svc/saveLocation",
                data: JSON.stringify(jData),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    var Result = eval('(' + response.d + ')');
                    alert(Result["Message"]);
                    alert("The Location ID is " + Result["Confirmation"] + " you can find the Location details in View Details column");

                    window.location = "NewDashboard.aspx";

                },
                failure: function (msg) {
                    alert(msg);
                },
                error: function (jqXHR, exception) {
                    if (jqXHR.status === 0) {
                        alert('Not connect.\n Verify Network.');
                    } else if (jqXHR.status == 404) {
                        alert('Requested page not found. [404]');
                    } else if (jqXHR.status == 500) {
                        alert('Internal Server Error [500].');
                    } else if (exception === 'parsererror') {
                        alert('Requested JSON parse failed.');
                    } else if (exception === 'timeout') {
                        alert('Time out error.');
                    } else if (exception === 'abort') {
                        alert('Ajax request aborted.');
                    } else {
                        alert('Uncaught Error.\n' + jqXHR.responseText);
                    }
                }

            });
            return false;
        }

        function clearSalesuser() {

            $('#txtBox').val('');
            $('#txtlocation').val('');
            $('#txtusername').val('');
            $('#txtemail').val('');
            $('#txtmobile').val('');

        }


        function getLocation() {

            var jData = {};
            jData.LocationID = $('#txtSearchID').val();


            $.ajax({
                type: "POST",
                url: "LocationService.svc/getLocation",
                data: JSON.stringify(jData),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    var Result = eval('(' + response.d + ')');
                    $('#txtLocationName').val(Result["LocationName"]);
                    $('#txtLocationAddress').val(Result["LocationAddress"]);
                    $('#txtLocationCountry').val(Result["LocationCountry"]);
                    $('#txtLocationState').val(Result["LocationState"]);
                    $('#txtLocationCity').val(Result["LocationCity"]);


                },
                failure: function (msg) {
                    alert(msg);
                },
                error: function (jqXHR, exception) {
                    if (jqXHR.status === 0) {
                        alert('Not connect.\n Verify Network.');
                    } else if (jqXHR.status == 404) {
                        alert('Requested page not found. [404]');
                    } else if (jqXHR.status == 500) {
                        alert('Internal Server Error [500].');
                    } else if (exception === 'parsererror') {
                        alert('Requested JSON parse failed.');
                    } else if (exception === 'timeout') {
                        alert('Time out error.');
                    } else if (exception === 'abort') {
                        alert('Ajax request aborted.');
                    } else {
                        alert('Uncaught Error.\n' + jqXHR.responseText);
                    }
                }

            });
            return false;
        }




        function updateLocation() {

            var jData = {};
            jData.LocationID = $('#txtSearchID').val();
            jData.LocationName = $('#txtLocationName').val();
            jData.LocationAddress = $('#txtLocationAddress').val();
            jData.LocationCountry = $('#txtLocationCountry').val();
            jData.LocationState = $('#txtLocationState').val();
            jData.LocationCity = $('#txtLocationCity').val();

            $.ajax({
                type: "POST",
                url: "LocationService.svc/modifyLocation",
                data: JSON.stringify(jData),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    var Result = eval('(' + response.d + ')');
                    alert(Result["Message"]);

                    window.location = "NewDashboard.aspx";

                },
                failure: function (msg) {
                    alert(msg);
                },
                error: function (jqXHR, exception) {
                    if (jqXHR.status === 0) {
                        alert('Not connect.\n Verify Network.');
                    } else if (jqXHR.status == 404) {
                        alert('Requested page not found. [404]');
                    } else if (jqXHR.status == 500) {
                        alert('Internal Server Error [500].');
                    } else if (exception === 'parsererror') {
                        alert('Requested JSON parse failed.');
                    } else if (exception === 'timeout') {
                        alert('Time out error.');
                    } else if (exception === 'abort') {
                        alert('Ajax request aborted.');
                    } else {
                        alert('Uncaught Error.\n' + jqXHR.responseText);
                    }
                }

            });
            return false;
        }


        function clearUpdateLocation() {

            $('#txtSearchID').val('');
            $('#txtLocationName').val('');
            $('#txtLocationAddress').val('');
            $('#txtLocationCountry').val('');
            $('#txtLocationState').val('');
            $('#txtLocationCity').val('');

        }

        function fetchLocation() {

            var jData = {};
            jData.LocationID = $('#txtSearch').val();


            $.ajax({
                type: "POST",
                url: "LocationService.svc/fetchLocation",
                data: JSON.stringify(jData),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    var Result = eval('(' + response.d + ')');
                    $('#fetLocationName').html(Result["LocationName"]);
                    $('#fetLocationAddress').html(Result["LocationAddress"]);
                    $('#fetLocationCountry').html(Result["LocationCountry"]);
                    $('#fetLocationState').html(Result["LocationState"]);
                    $('#fetLocationCity').html(Result["LocationCity"]);


                },
                failure: function (msg) {
                    alert(msg);
                },
                error: function (jqXHR, exception) {
                    if (jqXHR.status === 0) {
                        alert('Not connect.\n Verify Network.');
                    } else if (jqXHR.status == 404) {
                        alert('Requested page not found. [404]');
                    } else if (jqXHR.status == 500) {
                        alert('Internal Server Error [500].');
                    } else if (exception === 'parsererror') {
                        alert('Requested JSON parse failed.');
                    } else if (exception === 'timeout') {
                        alert('Time out error.');
                    } else if (exception === 'abort') {
                        alert('Ajax request aborted.');
                    } else {
                        alert('Uncaught Error.\n' + jqXHR.responseText);
                    }
                }

            });
            return false;
        }




        function deleteLocation() {

            var jData = {};
            jData.LocationID = $('#txtSearch').val();


            $.ajax({
                type: "POST",
                url: "LocationService.svc/removeLocation",
                data: JSON.stringify(jData),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    var Result = eval('(' + response.d + ')');
                    alert(Result["Message"]);

                    window.location = "NewDashboard.aspx";

                },
                failure: function (msg) {
                    alert(msg);
                },
                error: function (jqXHR, exception) {
                    if (jqXHR.status === 0) {
                        alert('Not connect.\n Verify Network.');
                    } else if (jqXHR.status == 404) {
                        alert('Requested page not found. [404]');
                    } else if (jqXHR.status == 500) {
                        alert('Internal Server Error [500].');
                    } else if (exception === 'parsererror') {
                        alert('Requested JSON parse failed.');
                    } else if (exception === 'timeout') {
                        alert('Time out error.');
                    } else if (exception === 'abort') {
                        alert('Ajax request aborted.');
                    } else {
                        alert('Uncaught Error.\n' + jqXHR.responseText);
                    }
                }

            });
            return false;
        }


        function changePassword() {

            var jData = {};
            jData.Password = $('#txtPassword').val();
            jData.NewPassword = $('#txtNewpassword').val();


            $.ajax({
                type: "POST",
                url: "LoginService.svc/changePwd",
                data: JSON.stringify(jData),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    var Result = eval('(' + response.d + ')');
                    alert(Result["Message"]);

                    window.location = "NewDashboard.aspx";

                },
                failure: function (msg) {
                    alert(msg);
                },
                error: function (jqXHR, exception) {
                    if (jqXHR.status === 0) {
                        alert('Not connect.\n Verify Network.');
                    } else if (jqXHR.status == 404) {
                        alert('Requested page not found. [404]');
                    } else if (jqXHR.status == 500) {
                        alert('Internal Server Error [500].');
                    } else if (exception === 'parsererror') {
                        alert('Requested JSON parse failed.');
                    } else if (exception === 'timeout') {
                        alert('Time out error.');
                    } else if (exception === 'abort') {
                        alert('Ajax request aborted.');
                    } else {
                        alert('Uncaught Error.\n' + jqXHR.responseText);
                    }
                }

            });
            return false;
        }

    </script>
    <script src="JS/jquery.validate.js" type="text/javascript"></script>
    <script src="JS/jquery.validation.functions.js" type="text/javascript"></script>
    <script src="JS/Shi-1.2.js" type="text/javascript"></script>
    <link href="CSS/jquery.validate.css" rel="stylesheet" type="text/css" />
    <link href="CSS/style33.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript">
        window.history.forward(1);
        document.attachEvent("onkeydown", my_onkeydown_handler);
        function my_onkeydown_handler() {
            switch (event.keyCode) {
                case 116: // F5;
                    event.returnValue = false;
                    event.keyCode = 0;
                    window.status = "We have disabled F5";
                    break;
            }
        }
    </script>
</head>
<body>
    <script type="text/javascript">
        $(function () {

            $types = $('.syncTypes');
            $creation = $('#creation');
            $updation = $('#updation');
            $deletion = $('#deletion');
            $types.change(function () {
                $this = $(this).val();
                if ($this == "create") {
                    $updation.slideUp(200);
                    $deletion.slideUp(200);
                    $creation.delay(200).slideDown(200);
                }
                else if ($this == "update") {
                    $creation.slideUp(200);
                    $deletion.slideUp(200);
                    $updation.delay(200).slideDown(200);
                }
                else if ($this == "delete") {

                    $creation.slideUp(200);
                    $updation.slideUp(200);
                    $deletion.delay(200).slideDown(200);
                }
            });
        });
    </script>
    <script type="text/javascript">
		<!--
        function showHide() {
            var chkBox = document.getElementById("updateByID");

            var txtBox = document.getElementById("txtBox");
            var txtBox1 = document.getElementById("txtBox1");

            if (chkBox.checked) {
                txtBox.style.visibility = "visible";
                txtBox1.style.visibility = "hidden";

            } else {
                txtBox1.style.visibility = "visible";
                txtBox.style.visibility = "hidden";

            }
        }

		-->
    </script>
    <div id="wrapper">
        <div id="header">
            <%--  <img src="http://www.rxvantage.com/sites/all/themes/rxvantages/images/dashboard-header.jpg"
                width="100%" height="120px;" />--%>
            <img src="IMAGE/Admin.jpg" width="100%" height="120px;" />
            <!-- <div id="header-center">
<form class="form-wrapper cf" >
        <input type="text" placeholder=label1.Text = IpassAstringfrompage1;"Search here..." required>
        <button type="submit">Search</button>
    </form>   
</div>  -->
            <div id="navbar">
                <ul id="menu">
                    <li><a href="NewDashboard.aspx">Home</a></li>
                    <%--<li><a href="#">Dashboard</a></li>--%>
                    <li><a href="Report.aspx">View Details</a></li>
                    <li>
                        <form runat="server">
                        <asp:Button ID="Button1" runat="server" Text="Logout" OnClick="Button1_Click" /></form>
                    </li>
                </ul>
            </div>
        </div>
        <div id="content">
            <label>
                Logged in :</label>
            <asp:Label ID="loggedperson" runat="server">ss</asp:Label>
            <br />
            <br />
            <div id="accordion">
                <h3>
                    CREATE SALESUSER</h3>
                <div>
                    <div class="ProfileDetails">
                        <div id="myContent">
                            <div class="divrow" style="margin-left: 40%;">
                                <div class="divlbl">
                                </div>
                                <input id="chkradio" type="radio" name="salesuser" value="create" class="syncTypes"
                                    name="syncTypes">
                                CREATE USER
                                <input id="chkradio" type="radio" name="salesuser" value="update" class="syncTypes"
                                    name="syncTypes">
                                UPDATE USER
                                <input id="chkradio" type="radio" name="salesuser" value="delete" class="syncTypes"
                                    name="syncTypes">
                                DELETE USER
                            </div>
                        </div>
                        <div id="creation" style="margin-top: 20px; margin-left: 240px; width: 550px; height: auto;
                            display: none; border: 1px #D8D8D8 solid; padding: 3px; top: 15px; position: relative;">
                            <div class="divrow">
                                <div class="divlbl">
                                    <label id="lblname">
                                    </label>
                                    <label id="dob">
                                        LOCATION</label>
                                </div>
                                <input class="required" type="text" name="bdob" id="location" onfocus="return refreshLocation();" />
                            </div>
                            <div class="divrow">
                                <div class="divlbl">
                                    <label id="lblname">
                                        NAME</label>
                                </div>
                                <input class="required" type="text" name="bname" id="name" onfocus="return refreshLocation();" />
                            </div>
                            <div class="divrow">
                                <div class="divlbl">
                                    <label id="lblname">
                                    </label>
                                    <label id="dob">
                                        EMAIL ID</label>
                                </div>
                                <input class="required" type="text" name="bdob" id="email" onfocus="return refreshLocation();" />
                            </div>
                            <div class="divrow">
                                <div class="divlbl">
                                    <label id="lblname">
                                        MOBILE NUMBER</label>
                                </div>
                                <input class="required" type="text" name="bname" id="mobile" onfocus="return refreshLocation();" />
                            </div>
                            <div style="">
                                <input class="button" type="submit" value="SUBMIT" style="margin-top: 20px; margin-left: 20px;
                                    margin-bottom: 20px;" onclick="return validateLocation();" />
                            </div>
                        </div>
                        <div id="updation" style="margin-top: 20px; margin-left: 240px; width: 550px; height: auto;
                            display: none; border: 1px #D8D8D8 solid; padding: 3px; top: 15px; position: relative">
                            <div style="float: right">
                                <a href="Report.aspx">View Salesuser Details</a><br />
                            </div>
                            <br />
                            <div class="divrow">
                                <div class="divlbl">
                                    <label id="Label18">
                                        ENTER THE VALUE</label>
                                </div>
                                <input class="" type="text" name="txtBox" style="width: 60px;" onblur="showData()"
                                    id="txtBox" placeholder="ID Here..." />
                                <input class="button" type="submit" value="Fetch" style="margin-left: 10px; width: 80px;"
                                    onclick="return fetchUserDetails()" />
                            </div>
                            <div id="searchBlock" style="display: none;">
                                <div class="divrow">
                                    <div class="divlbl">
                                        <label id="lblname">
                                        </label>
                                        <label id="dob">
                                            LOCATION</label>
                                    </div>
                                    <input id="txtlocation" class="" type="text" name="bdob" />
                                </div>
                                <div class="divrow">
                                    <div class="divlbl">
                                        <label id="lblname">
                                            NAME</label>
                                    </div>
                                    <input id="txtusername" class="" type="text" name="bname" />
                                </div>
                                <div class="divrow">
                                    <div class="divlbl">
                                        <label id="lblname">
                                        </label>
                                        <label id="dob">
                                            EMAIL ID</label>
                                    </div>
                                    <input id="txtemail" class="" type="text" name="bdob" />
                                </div>
                                <div class="divrow">
                                    <div class="divlbl">
                                        <label id="lblname">
                                            MOBILE NUMBER</label>
                                    </div>
                                    <input id="txtmobile" class="" type="text" name="bname" />
                                </div>
                            </div>
                            <div style="">
                                <input class="button" type="submit" value="UPDATE" style="margin-top: 20px; margin-left: 20px;
                                    margin-bottom: 20px;" onclick="return validateSalesuser();" />
                                <input class="button" type="submit" value="RESET" style="margin-left: 10px;" onclick="return clearSalesuser();" />
                            </div>
                        </div>
                        <div id="deletion" style="margin-top: 20px; margin-left: 240px; width: 550px; height: auto;
                            display: none; border: 1px #D8D8D8 solid; padding: 3px; top: 15px; position: relative">
                            <div class="divrow">
                                <div class="divlbl">
                                    <label id="lblname">
                                    </label>
                                    <label id="dob">
                                        SEARCH BY ID</label>
                                </div>
                                <input class="" style="width: 60px;" id="fetID" type="text" name="bdob" />
                                <input class="button" type="submit" value="FETCH" style="margin-left: 10px;" onclick="return getsalesuser();" />
                            </div>
                            <div id="UpdateBlocks" style="">
                                <div class="divrow">
                                    <div class="divlbl">
                                        <label id="lblname">
                                            LOCATION</label>
                                    </div>
                                    <%-- <input id="fetlocation" class="textfield" type="text" disabled="disabled" name = "bdob" /> --%>
                                    <span id="fetlocation"></span>
                                    <br />
                                </div>
                                <div class="divrow">
                                    <div class="divlbl">
                                        <label id="lblname">
                                            NAME</label>
                                    </div>
                                    <span id="fetusername"></span>
                                    <br />
                                </div>
                                <div class="divrow">
                                    <div class="divlbl">
                                        <label id="lblname">
                                            EMAIL ID</label>
                                    </div>
                                    <span id="fetemail"></span>
                                    <br />
                                </div>
                                <div class="divrow">
                                    <div class="divlbl">
                                        <label id="lblname">
                                            MOBILE NUMBER</label>
                                    </div>
                                    <span id="fetmobile"></span>
                                    <br />
                                </div>
                            </div>
                            <div style="">
                                <input class="button" type="submit" value="DELETE" style="margin-top: 20px; margin-left: 20px;
                                    margin-bottom: 20px;" onclick="return removeSalesuser();" />
                            </div>
                        </div>
                    </div>
                </div>
                <h3>
                    CREATE LOCATION</h3>
                <div>
                    <div id="myContents" style="font-size: 100%; font: 12px arial, verdana; margin-left: 35%;
                        padding: 0; text-align: left;">
                        <input name="property_q1" type="radio" value="create" onclick="showMessage(1)" />CREATE
                        LOCATION
                        <input name="property_q1" type="radio" value="update" onclick="showMessage(2)" />
                        UPDATE LOCATION
                        <input name="property_q1" type="radio" value="delete" onclick="showMessage(3)" />
                        DELETE LOCATION
                    </div>
                    <div id="cre" style="margin-top: 20px; margin-left: 240px; width: 550px; height: auto;
                        display: none; border: 1px #D8D8D8 solid; padding: 3px; top: 15px; position: relative;">
                        <div class="divrow">
                            <div class="divlbl">
                                <label id="Label1">
                                </label>
                                <label id="Label2">
                                    NAME</label>
                            </div>
                            <input class="" type="text" id="locName" />
                        </div>
                        <div class="divrow">
                            <div class="divlbl">
                                <label id="Label3">
                                    ADDRESS
                                </label>
                            </div>
                            <input class="" type="text" id="locAddress" />
                        </div>
                        <div class="divrow">
                            <div class="divlbl">
                                <label id="Label4">
                                </label>
                                <label id="Label5">
                                    COUNTRY</label>
                            </div>
                            <input class="" type="text" id="locCountry" />
                        </div>
                        <div class="divrow">
                            <div class="divlbl">
                                <label id="Label6">
                                    STATE</label>
                            </div>
                            <input class="" type="text" id="locState" />
                        </div>
                        <div class="divrow">
                            <div class="divlbl">
                                <label id="Label7">
                                    CITY</label>
                            </div>
                            <input class="" type="text" id="locCity" />
                        </div>
                        <div style="">
                            <input class="button" onclick="return createLocation();" type="submit" value="SUBMIT"
                                style="margin-top: 20px; margin-left: 20px; margin-bottom: 20px;" />
                        </div>
                    </div>
                    <div id="mod" style="margin-top: 20px; margin-left: 240px; width: 550px; height: auto;
                        display: none; border: 1px #D8D8D8 solid; padding: 3px; top: 15px; position: relative;">
                        <div style="float: right">
                            <a href="Report.aspx">View Location Details</a><br />
                        </div>
                        <br />
                        <div class="divrow">
                            <div class="divlbl">
                                <label id="Label16">
                                    SEARCH BY ID</label>
                            </div>
                            <div style="float: left">
                                <input id="txtSearchID" class="" style="width: 80px" type="text" name="bdob" />
                                <input class="button" type="button" value="Fetch" style="margin-left: 10px; width: 100px"
                                    onclick="return getLocation()" />
                            </div>
                            </br>
                        </div>
                        <div class="divrow">
                            <div class="divlbl">
                                <label id="Label9">
                                    NAME</label>
                            </div>
                            <input id="txtLocationName" class="" type="text" name="bdob" />
                        </div>
                        <div class="divrow">
                            <div class="divlbl">
                                <label id="Label10">
                                    ADDRESS
                                </label>
                            </div>
                            <input class="" type="text" id="txtLocationAddress" name="bname" />
                        </div>
                        <div class="divrow">
                            <div class="divlbl">
                                <label id="Label11">
                                </label>
                                <label id="Label12">
                                    COUNTRY</label>
                            </div>
                            <input class="" type="text" id="txtLocationCountry" name="bdob" />
                        </div>
                        <div class="divrow">
                            <div class="divlbl">
                                <label id="Label13">
                                    STATE</label>
                            </div>
                            <input class="" type="text" name="bname" id="txtLocationState" />
                        </div>
                        <div class="divrow">
                            <div class="divlbl">
                                <label id="Label14">
                                    CITY</label>
                            </div>
                            <input class="" type="text" name="bname" id="txtLocationCity" />
                        </div>
                        <div style="">
                            <input class="button" onclick="return updateLocation()" type="submit" value="SUBMIT"
                                style="margin-top: 20px; margin-left: 20px; margin-bottom: 20px;" />
                            <input class="button" type="button" value="RESET" style="margin-left: 10px;" onclick="return clearUpdateLocation()" />
                        </div>
                    </div>
                    <div id="del" style="margin-top: 20px; margin-left: 240px; width: 550px; height: auto;
                        display: none; border: 1px #D8D8D8 solid; padding: 3px; top: 15px; position: relative;">
                        <div class="divrow">
                            <div class="divlbl">
                                <label id="lblname">
                                    SEARCH BY ID</label>
                            </div>
                            <input class="" type="text" id="txtSearch" style="width: 80px;" name="bname" />
                            <input class="button" type="submit" value="Fetch" style="margin-left: 10px; width: 100px"
                                onclick="return fetchLocation()" />
                        </div>
                        <div class="divrow">
                            <div class="divlbl">
                                <label id="lblname">
                                    NAME</label>
                            </div>
                            <%--<input id="fetLocationName" class="textfield" disabled="disabled" type="text" name="bdob" />--%>
                            <span id="fetLocationName"></span>
                            <br />
                        </div>
                        <div class="divrow">
                            <div class="divlbl">
                                <label id="lblname">
                                    ADDRESS
                                </label>
                            </div>
                            <span id="fetLocationAddress"></span>
                            <br />
                        </div>
                        <div class="divrow">
                            <div class="divlbl">
                                <label id="lblname">
                                    COUNTRY</label>
                            </div>
                            <span id="fetLocationCountry"></span>
                            <br />
                        </div>
                        <div class="divrow">
                            <div class="divlbl">
                                <label id="lblname">
                                    STATE</label>
                            </div>
                            <span id="fetLocationState"></span>
                            <br />
                        </div>
                        <div class="divrow">
                            <div class="divlbl">
                                <label id="lblname">
                                    CITY</label>
                            </div>
                            <span id="fetLocationCity"></span>
                            <br />
                        </div>
                        <div style="">
                            <input class="button" onclick="return deleteLocation()" type="submit" value="DELETE"
                                style="margin-top: 20px; margin-left: 20px; margin-bottom: 20px;" />
                        </div>
                    </div>
                </div>
                <h3>
                    CHANGE PASSWORD</h3>
                <div>
                    <div id="passBlock" style="margin-top: 20px; margin-left: 140px; width: 750px; height: auto;
                        border: 1px #D8D8D8 solid; padding: 3px; top: 15px;">
                        <form id="form" action="" method="post">
                        <div class="divrow">
                            <div class="divlbl">
                                <label id="lblname">
                                </label>
                                <label id="dob">
                                    CURRENT PASSWORD</label>
                            </div>
                            <input class="" id="txtPassword" type="password" name="password" />
                        </div>
                        <div class="divrow">
                            <div class="divlbl">
                                <label for="pass" id="lblname">
                                    NEW PASSWORD</label>
                            </div>
                            <input class="" type="password" id="txtNewpassword" class="text" name="your_pass" />
                        </div>
                        <div class="divrow">
                            <div class="divlbl">
                                <label for="c_pass" id="lblname">
                                </label>
                                <label id="dob">
                                    CONFIRM PASSWORD</label>
                            </div>
                            <input class="" type="password" id="c_pass" class="text" name="your_c_pass" value=""
                                onblur="confirmPass()" />
                        </div>
                        <div style="">
                            <input class="button" type="submit" value="SUBMIT" style="margin-top: 20px; margin-left: 20px;
                                margin-bottom: 20px;" onclick="return changePassword();" />
                        </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <div id="footer">
            Copyright © Kaizen Technosoft</div>
    </div>
    <script type="text/javascript">

        function confirmPass() {

            var pass = document.getElementById("pass").value

            var confPass = document.getElementById("c_pass").value

            if (pass == confPass) {

                Sexy.alert('<h1>Administrator</h1><br/>Passwords Matches'); return false;

            } else if (pass != confPass) {

                Sexy.error('<h1>Adminstrator</h1> Password Mismatch'); return false;

            }

        }

    </script>
    <script type="text/javascript">

        function showData() {

            document.getElementById("searchBlock").style.display = "block";

        }
   
    </script>
    <script type="text/javascript">

        function showLocationBlock() {

            document.getElementById("locationBlock").style.display = "block";
        }
   
    </script>
</body>
</html>
